package com.ns.scs.comments.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ns.scs.comments.dto.CommentsPageDto;
import com.ns.scs.comments.entry.CommentsEntry;
import com.ns.scs.comments.vo.CommentsVO;
import com.ns.scs.my.vo.MyCommentsVO;

import java.util.List;

/**
 * 资源评论接口类
 *
 * @author lw
 */
public interface ICommentsService extends IService<CommentsEntry> {

    /**
     * 分页查询
     *
     * @param dto 参数
     * @return PropEntryVO
     */
    Page<CommentsVO> getList(CommentsPageDto dto);

    /**
     * 查询资源相关评论
     *
     * @param resourceId 资源id
     * @return RsrCommentVO
     */
    List<CommentsVO> getByResourceId(Long resourceId);

    /**
     * 点赞
     *
     * @param id  评论id
     * @param uid 用户
     */
    int thumbsUp(Long id, Long uid);

    /**
     * 评论
     *
     * @param entry 对象
     * @return RsrCommentVO
     */
    CommentsVO comment(CommentsEntry entry);


    /**
     * 根据资源id、用户id、类型查询
     *
     * @param resourceId 资源id
     * @param uid        用户id
     * @param type       类型
     * @return CollectionEntry
     */
    List<MyCommentsVO> getByResourceIdAndUidAndType(Long resourceId, Long uid, String type);

    /**
     * 审核
     *
     * @param id     评论id
     * @param status 状态
     */
    boolean audit(Long id, Integer status);
}
